package sevensoft.结构型模式.装饰模式;

public class Demo {
    public static void main(String[] args) {
        Food food = new Spaghetti();
        System.out.println(food);
        food=new Tomato(food);
        food.cost();
        System.out.println(food);

        Food food2=new Sausage(new Tomato(new Pizza()));
        System.out.println(food2);

        Food food3=new Sausage(new Spaghetti());
        System.out.println(food3);
    }
}
